import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
import store from "./store"
Vue.prototype.$store = store
Vue.config.productionTip = false

// 引入全局组件
import divider from "@/components/common/divider.vue"
Vue.component('divider',divider)
import price from "@/components/common/price.vue"
Vue.component('price',price)
// 引入全局加载动画
import loading from "@/components/common/loading.vue"
Vue.component('loading',loading)
import loadingPlus from "@/common/mixin/loading-plus.vue"
Vue.component('loading-plus',loadingPlus)

import $H from '@/common/request.js';
Vue.prototype.$H = $H

import $G from '@/common/global.js';
Vue.prototype.$G = $G

// 权限跳转
Vue.prototype.navigateTo = (options)=>{
// 判断用户是否登录
	if(!store.state.user.loginStatus){
		setTimeout(()=>{
			uni.showToast({
				title: '请先登录',
				icon:'none'
			});
		},1000)
		uni.navigateTo({
			url: '/pages/login/login',
		});
	}
	uni.navigateTo(options);
}

import $U from './common/lib/util.js';
Vue.prototype.$U = $U

App.mpType = 'app'
const app = new Vue({
	store,
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif